package br.com.moxeon.model.financialitems;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import br.com.moxeon.model.MoxeonControlledPersistentEntity;
import br.com.moxeon.model.financialaccounts.BankAccount;


@SuppressWarnings("serial")
@Entity
@Table(name="coupon")
public class Coupon extends MoxeonControlledPersistentEntity {
	@Column(nullable=false,name="origin_place")
	private String originPlace;
	private String observation;
	@ManyToOne(cascade=CascadeType.ALL, targetEntity=BankAccount.class, fetch=FetchType.LAZY,optional=false)
	@JoinColumn(nullable=false, name="bank_account_id")
	private BankAccount account;
	@OneToMany(cascade=CascadeType.ALL, mappedBy="coupon", targetEntity=CashierCheck.class, fetch=FetchType.LAZY)
	private List<CashierCheck> checks;
	public String getOriginPlace() {
		return originPlace;
	}
	public String getObservation() {
		return observation;
	}
	public BankAccount getAccount() {
		return account;
	}
	public List<CashierCheck> getChecks() {
		return checks;
	}
	public void setOriginPlace(String originPlace) {
		this.originPlace = originPlace;
	}
	public void setObservation(String observation) {
		this.observation = observation;
	}
	public void setAccount(BankAccount account) {
		this.account = account;
	}
	public void setChecks(List<CashierCheck> checks) {
		this.checks = checks;
	}
	
	
	
	
	
}